
function localiza (lat, long, nombre, tipo, userID, map)
{
	var point = new GLatLng(lat, long, true);
	var myIcon;
	
	//tipo es un entero para elegir el icono, 0 - evento, 1...n - usuario
	var baseIcon = new GIcon();
	if(tipo == 4){
		var baseIcon = new GIcon();
		baseIcon.image = "http://maps.google.com/mapfiles/ms/micons/man.png";
		baseIcon.shadow = "http://maps.google.com/mapfiles/ms/micons/man.shadow.png";
		baseIcon.iconSize = new GSize(32, 32);
		baseIcon.shadowSize = new GSize(59, 32);
	}
	else if(tipo == 6){
		var baseIcon = new GIcon();
		baseIcon.image = "http://maps.google.com/mapfiles/ms/micons/woman.png";
		baseIcon.shadow = "http://maps.google.com/mapfiles/ms/micons/woman.shadow.png";
		baseIcon.iconSize = new GSize(32, 32);
		baseIcon.shadowSize = new GSize(59, 32);
	}
	
	baseIcon.iconAnchor = new GPoint(17, 17);
	baseIcon.infoWindowAnchor = new GPoint(9, 2);
	baseIcon.infoShadowAnchor = new GPoint(18, 25);
	myIcon = new GIcon (baseIcon);

	markerOptions = {icon: myIcon, draggable: true};
	var marker = new GMarker(point, markerOptions);
		
    GEvent.addListener(marker, "dragend", function() {       
		  nuevaLatitud = marker.getLatLng().lat();
		  nuevaLongitud = marker.getLatLng().lng();});
    
   	
	map.addOverlay(marker);
}

function enviar()
{
	var nombre = document.getElementById("nombre").value;
	var apellidos = document.getElementById("apellidos").value;
	var fechaN = document.getElementById("diaC").value +"-"+document.getElementById("mesC").value +"-"+ document.getElementById("yearC").value;
	var sexo= document.getElementsByName("sexo")[0].checked==true?"H":"M";
	var direccion = document.getElementById("direccion").value;
	var email = document.getElementById("email").value;
	var nacionalidad = document.getElementById("nacionalidad").value;
	var lat = nuevaLatitud;
	var lng = nuevaLongitud;
	//alert(sexo);
	location.href= "FrontController?action=redirect&url=datosPersonales.jsp?accion=actualizaDatos&nombre="+nombre+"&apellidos="+apellidos+"&fechaN="+fechaN+"&sexo="+sexo+"&direccion="+direccion+"&email="+email+"&nacionalidad="+nacionalidad+"&lat="+lat+"&lng="+lng;
	
}
function restablecer()
{
	location.href="FrontController?action=redirect&url=datosPersonales.jsp";
}




	



  
  